]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
telepathyClient: insert a timestamp between log messages and pending messages
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 24 Mar 2011 11:09:04 +0000 (07:09 -0400)
committerOwen W. Taylor <otaylor@fishsoup.net>
Tue, 29 Mar 2011 03:05:55 +0000 (23:05 -0400)
This will give a visual break, giving a bit of clarity when a message
is received from a new contact.

https://bugzilla.gnome.org/show_bug.cgi?id=645609

js/ui/telepathyClient.js

index b59c0581c654b319bba11df9845dbd68b2f5f848..675181a260c4f6ef67ae573db693dc4c3c87e31c 100644 (file)
@@ -249,6 +249,8 @@ Source.prototype = {
         let pendingTpMessages = this._channel.get_pending_messages();
         let pendingMessages = pendingTpMessages.map(function (tpMessage) { return makeMessageFromTpMessage(tpMessage, NotificationDirection.RECEIVED); });
 
+        let showTimestamp = false;
+
         for (let i = 0; i < logMessages.length; i++) {
             let logMessage = logMessages[i];
             let isPending = false;
@@ -262,17 +264,18 @@ Source.prototype = {
                 }
             }
 
-            if (!isPending)
+            if (!isPending) {
+                showTimestamp = true;
                 this._notification.appendMessage(logMessage, true);
+            }
         }
 
+        if (showTimestamp)
+            this._notification.appendTimestamp();
+
         for (let i = 0; i < pendingMessages.length; i++)
             this._notification.appendMessage(pendingMessages[i], true);
 
-        // Only show the timestamp if we have at least one message.
-        if (pendingMessages.length > 0 || logMessages.length > 0)
-            this._notification.appendTimestamp();
-
         if (pendingMessages.length > 0)
             this.notify();
     },